import { request } from '../request';

/** 获取API权限组列表 */
export function fetchGetGroups(params?: Api.Common.CommonSearchParams) {
  return request<GroupApi.GroupListResponse>({ 
    url: '/adminapi/group/index',
    method: 'get',
    params
  });
}

/** 添加API权限组 */
export function addGroup(data: Partial<GroupApi.Group>) {
  return request({
    url: '/adminapi/group/add',
    method: 'post',
    data
  });
}

/** 编辑API权限组 */
export function editGroup(data: Partial<GroupApi.Group>) {
  return request({
    url: `/adminapi/group/edit/ids/${data.id}`,
    method: 'post',
    data
  });
}

/** 删除API权限组 */
export function deleteGroup(id) {
  return request({
    url: `/adminapi/group/del/ids`,
    method: 'post',
    data:{ids:id}
  });
} 